home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Date & Calendars / 1-year.izs next >
Text File  |  2005-07-20  |  5KB  |  172 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>1 Year Calendar
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>One of the most versatile calendar scripts we've ever seen, this one displays it for one entire year- any year! Use it as a replacement for the "real" calendar now sitting on your wall... 
  7. <!/DESCRIPTION> 
  8.  
  9. <!CATEGORY>Calenders<!/CATEGORY>
  10.  
  11. <!SCRIPT>
  12. <!-- START OF SCRIPT -->
  13. <!-- Simply paste the below into the <body> section of your page where you wish the calendar to appear:-->
  14. <script language="javascript">
  15. <!--
  16. // fill the month table with column headings
  17. function day_title(day_name){
  18.      document.write("<TD ALIGN=center WIDTH=35>"+day_name+"</TD>")
  19. }
  20. // fills the month table with numbers
  21. function fill_table(month,month_length)
  22.   day=1
  23.   // begin the new month table
  24.   document.write("<TABLE BORDER=3 CELLSPACING=3 CELLPADDING=%3><TR>")
  25.   document.write("<TD COLSPAN=7 ALIGN=center><B>"+month+"   "+year+"</B><TR>")
  26.   // column headings
  27.   day_title("Sun")
  28.   day_title("Mon")
  29.   day_title("Tue")
  30.   day_title("Wed")
  31.   day_title("Thu")
  32.   day_title("Fri")
  33.   day_title("Sat")
  34.   // pad cells before first day of month
  35.   document.write("</TR><TR>")
  36.   for (var i=1;i<start_day;i++){
  37.         document.write("<TD>")
  38.   }
  39.   // fill the first week of days
  40.   for (var i=start_day;i<8;i++){
  41.         document.write("<TD ALIGN=center>"+day+"</TD>")
  42.         day++
  43.   }
  44.   document.write("<TR>")
  45.   // fill the remaining weeks
  46.   while (day <= month_length) {
  47.      for (var i=1;i<=7 && day<=month_length;i++){
  48.          document.write("<TD ALIGN=center>"+day+"</TD>")
  49.          day++
  50.      }
  51.      document.write("</TR><TR>")
  52.      // the first day of the next month
  53.      start_day=i
  54.   }
  55.   document.write("</TR></TABLE><BR>")
  56. }
  57. // end hiding -->
  58.  
  59. </script>
  60.  
  61. <script language="javascript">
  62.  
  63. // CAHNGE the below variable to the CURRENT YEAR
  64. year=2001
  65.  
  66. // first day of the week of the new year
  67. today= new Date("January 1, "+year)
  68. start_day = today.getDay() + 1   // starts with 0
  69. fill_table("January",31)
  70. fill_table("February",29)
  71. fill_table("March",31)
  72. fill_table("April",30)
  73. fill_table("May",31)
  74. fill_table("June",30)
  75. fill_table("July",31)
  76. fill_table("August",31)
  77. fill_table("September",30)
  78. fill_table("October",31)
  79. fill_table("November",30)
  80. fill_table("December",31)
  81. </script>
  82.  
  83. <p align="center"><font face="arial" size="-2">This free script provided by</font><br>
  84. <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
  85. Kit</a></font></p>
  86.  
  87. <!-- END OF SCRIPT -->
  88. <!/SCRIPT>
  89.  
  90. <!PREVIEW>
  91. <!-- Simply paste the below into the <body> section of your page where you wish the calendar to appear:                -->
  92. <!-- START OF SCRIPT -->
  93.  
  94. <script language="javascript">
  95. <!--
  96. // fill the month table with column headings
  97. function day_title(day_name){
  98.      document.write("<TD ALIGN=center WIDTH=35>"+day_name+"</TD>")
  99. }
  100. // fills the month table with numbers
  101. function fill_table(month,month_length)
  102.   day=1
  103.   // begin the new month table
  104.   document.write("<TABLE BORDER=3 CELLSPACING=3 CELLPADDING=%3><TR>")
  105.   document.write("<TD COLSPAN=7 ALIGN=center><B>"+month+"   "+year+"</B><TR>")
  106.   // column headings
  107.   day_title("Sun")
  108.   day_title("Mon")
  109.   day_title("Tue")
  110.   day_title("Wed")
  111.   day_title("Thu")
  112.   day_title("Fri")
  113.   day_title("Sat")
  114.   // pad cells before first day of month
  115.   document.write("</TR><TR>")
  116.   for (var i=1;i<start_day;i++){
  117.         document.write("<TD>")
  118.   }
  119.   // fill the first week of days
  120.   for (var i=start_day;i<8;i++){
  121.         document.write("<TD ALIGN=center>"+day+"</TD>")
  122.         day++
  123.   }
  124.   document.write("<TR>")
  125.   // fill the remaining weeks
  126.   while (day <= month_length) {
  127.      for (var i=1;i<=7 && day<=month_length;i++){
  128.          document.write("<TD ALIGN=center>"+day+"</TD>")
  129.          day++
  130.      }
  131.      document.write("</TR><TR>")
  132.      // the first day of the next month
  133.      start_day=i
  134.   }
  135.   document.write("</TR></TABLE><BR>")
  136. }
  137. // end hiding -->
  138.  
  139. </script>
  140.  
  141. <script language="javascript">
  142.  
  143. // CAHNGE the below variable to the CURRENT YEAR
  144. year=2001
  145.  
  146. // first day of the week of the new year
  147. today= new Date("January 1, "+year)
  148. start_day = today.getDay() + 1   // starts with 0
  149. fill_table("January",31)
  150. fill_table("February",29)
  151. fill_table("March",31)
  152. fill_table("April",30)
  153. fill_table("May",31)
  154. fill_table("June",30)
  155. fill_table("July",31)
  156. fill_table("August",31)
  157. fill_table("September",30)
  158. fill_table("October",31)
  159. fill_table("November",30)
  160. fill_table("December",31)
  161. </script>
  162.  
  163. <p align="center"><font face="arial" size="-2">This free script provided by</font><br>
  164. <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
  165. Kit</a></font></p>
  166.  
  167. <!-- END OF SCRIPT -->
  168. <!/PREVIEW>
  169.  
  170. <!RELATED>NONE<!/RELATED>